Optical spectroscopy is used for various sensory applications. One way of making an optical spectroscope includes directing a light beam containing various wavelengths at a grating. The grating diffracts the light beam. An angle of diffraction of the diffracted light beam depends on a wavelength of the light beam and an incident angle of the light beam. The various wavelengths of the light beam are diffracted at different angles by the grating due to the difference in wavelength. The diffracted light is then directed to a photodetector. A location at which the light beam contacts the photodetector is determined by the wavelength of the light beam. By detecting an amount of light at each location, the photodetector is capable of determining a spectrum of the light beam.